<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class WidgetServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {

        view()->composer(
            'Widget.Head', 'App\Http\Widgets\Head'
        );

        view()->composer(
            'Widget.Menu', 'App\Http\Widgets\Menu'
        );

        view()->composer(
            'Widget.Body', 'App\Http\Widgets\Body'
        );
        // foot
        view()->composer(
            'Widget.Foot', 'App\Http\Widgets\Foot'
        );

        // 使用基于闭包的composers...
        //view()->composer('dashboard', function ($view) {

        //});
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
